CPP = g++
Flag = -g -fPIC

CPPS = $(wildcard *.cpp )
OBJS = $(patsubst %.cpp, %.o, $(CPPS))
INCLUDE = -I ./../ -I /usr/include/mysql/ -I ./data/
LINK_INC = -L //usr/local/lib/
LINK = -ltest -lpthread -lprotobuf 

TARGET= server

PRECPPS = $(wildcard ./../*.cpp )
PREOBJS = $(patsubst %.cpp, %.o, $(PRECPPS))

all : $(TARGET)

$(OBJS): $(CPPS)
	$(CPP) $(Flag) -c  $(CPPS)  $(INCLUDE)

$(TARGET) : $(OBJS)
	$(CPP) $(Flag) -g -o $(TARGET) $(OBJS) $(PREOBJS) $(LINK_INC) $(LINK) 

.PHONY: all clean

clean:
	rm -f *.o $(TARGET)

